package demo_0326.v2;

public class DrawApp {
    public static void draw (Shape[] shape) {
        for (int i = 0; i < shape.length; i++) {
            shape[i].draw();
        }
        System.out.println();
        System.out.println("---------------------");
    }

    public static void main(String[] args) {
        // 定义一个数组，存储圆形
        Circle[] circles = new Circle[6];
        circles[0] = new Circle(10, 20, 30);
        circles[1] = new Circle(50, 60, 70);
        circles[2] = new Circle(90, 100, 110);
        circles[3] = new Circle(130, 140, 150);
        circles[4] = new Circle(170, 180, 190);
        circles[5] = new Circle(210, 220, 230);
        draw(circles);
        // 定义一个数组，存储矩形
        Rectangle[] rectangles = new Rectangle[6];
        rectangles[0] = new Rectangle(10, 20, 30, 40);
        rectangles[1] = new Rectangle(50, 60, 70, 80);
        rectangles[2] = new Rectangle(90, 100, 110, 120);
        rectangles[3] = new Rectangle(130, 140, 150, 160);
        rectangles[4] = new Rectangle(170, 180, 190, 200);
        rectangles[5] = new Rectangle(210, 220, 230, 240);
        draw(rectangles);
    }
}
